package com.java.project1;
//abstract class
public class university {
    public static void main(String[] args) {
    	persona[] ob = new persona[2];
    	ob[0] = new student("abani", 1234);
    	ob[1] = new teacher("madhu", 2345);
    	ob[0].display();
    	ob[1].display();
    }
}
 
	abstract class persona
	{
		String name;

		/**
		 * @param name
		 */
		public persona(String name) {
			this.name = name;
		}
		
        public abstract void display();

	}
	
    class student extends persona
    {
    	int rollno;
    	public student(String name,int roll) {
			// TODO Auto-generated constructor stub
    		super(name);
    		this.rollno = roll;
		}
		@Override
		public void display() {
			// TODO Auto-generated method stub
			System.out.println("Student executed"+rollno);
		}
    }
    
    class teacher extends persona
    {
    	int salary;
    	public teacher(String name,int s) {
			super(name);
			salary = s;
			// TODO Auto-generated constructor stub
		}
		@Override
		public void display() {
			// TODO Auto-generated method stub
			System.out.println("teacher executed"+salary);
		}

 	
    }
    





